package cn.didi.feidi.javabackend.server.waterdeliver.utils;

import cn.didi.feidi.javabackend.server.waterdeliver.constant.address.SocketHttpAddress;
import cn.didi.feidi.javabackend.server.waterdeliver.dto.SocketMessage;
import org.springframework.web.client.RestTemplate;

/**
 * Created by lindanpeng on 2017/7/18.
 */
public class SocketUtil {
    /**
     * 发送消息给socket服务器
     * @param socketMessage
     */
    public static void sendMessage(SocketMessage socketMessage,String path){
        RestTemplate restTemplate=new RestTemplate();
        restTemplate.postForObject(UrlUtil.getServerURL(SocketHttpAddress.HOST,SocketHttpAddress.PORT,path,null),socketMessage,String.class);
        System.out.print("POST POST POST");
    }
}
